/*
 * UAE - The Un*x Amiga Emulator
 *
 * Serial Line Emulation
 *
 * Copyright 1996, 1997 Stefan Reinauer <stepan@linux.de>
 * Copyright 1997 Christian Schmitt <schmitt@freiburg.linux.de>
 */

#pragma once

extern void serial_init();
extern void serial_exit();
extern void serial_dtr_off();
extern void serial_dtr_on();

extern ushort SERDATR();
extern int SERDATS();
extern void SERPER(ushort w);
extern void SERDAT(ushort w);

extern byte serial_writestatus(byte, byte);
extern byte serial_readstatus(byte);
extern void serial_uartbreak(int);
extern ushort serdat;

extern int doreadser, serstat;

extern void serial_flush_buffer();

extern void serial_hsynchandler();
extern void serial_check_irq();

extern int uaeser_getdatalenght();
extern int uaeser_getbytespending(void*);
extern int uaeser_open(void*, void*, int);
extern void uaeser_close(void*);
extern int uaeser_read(void*, byte* data, uint len);
extern int uaeser_write(void*, byte* data, uint len);
extern int uaeser_query(void*, ushort* status, uint* pending);
extern int uaeser_setparams(void*, int baud, int rbuffer, int bits, int sbits, int rtscts, int parity, uint xonxoff);
extern int uaeser_break(void*, int brklen);
extern void uaeser_signal(void*, int source);
extern void uaeser_trigger(void*);
extern void uaeser_clearbuffers(void*);

extern void enet_writeser(ushort);
extern int enet_readseravail();
extern int enet_readser(ushort* buffer);
extern int enet_open(const TCHAR* name);
extern void enet_close();